// 友链页面组件样式
@use '../variables' as *;
.friends-page {
    min-height: 100vh;
    background-color: #f8fafc;
    display: flex;
    flex-direction: column;
}

// 主要内容区域样式
.main-content {
    padding-top: 64px;
    background: url('/src/assets/pic/friends_bg.png') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    flex: 1;
    min-height: calc(100vh - 64px - 120px); // 减去导航栏高度和页脚高度
}

.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

// 友链网格区域样式
.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

// 欢迎区域样式
.welcome-section {
    text-align: center;
    padding: 80px 0 20px; // 减少底部padding
    background: rgba(255, 255, 255, 0);
    border-radius: $radius-xl;
    margin-bottom: 10px; // 减少底部margin
    .welcome-icon {
        margin-bottom: 24px;
        .el-icon {
            font-size: 48px;
            color: white;
            text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }
    }
    .welcome-title {
        font-size: 2.5rem;
        font-weight: $font-bold;
        color: white;
        margin: 0 0 16px 0;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        animation: fadeInUp 1s ease-out;
    }
    .welcome-subtitle {
        font-size: 1.2rem;
        color: rgba(255, 255, 255, 0.9);
        margin: 0 0 8px 0;
        font-weight: $font-medium;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
        animation: fadeInUp 1s ease-out 0.1s both;
    }
    .welcome-description {
        font-size: 1rem;
        color: rgba(255, 255, 255, 0.8);
        margin: 0 0 32px 0;
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
        animation: fadeInUp 1s ease-out 0.2s both;
    }
    .welcome-actions {
        display: flex;
        justify-content: center;
        gap: 16px;
        flex-wrap: wrap;
        animation: fadeInUp 1s ease-out 0.3s both;
        .action-btn {
            padding: 12px 24px;
            border-radius: $radius-md;
            font-size: 14px;
            font-weight: $font-medium;
            cursor: pointer;
            transition: all $transition-normal;
            border: none;
            &.primary {
                background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
                color: white;
                box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
                &:hover {
                    transform: translateY(-2px);
                    box-shadow: 0 8px 20px rgba(74, 144, 226, 0.4);
                }
            }
            &.secondary {
                background: rgba(255, 255, 255, 0.9);
                color: #4A90E2;
                border: 2px solid rgba(255, 255, 255, 0.8);
                -webkit-backdrop-filter: blur(10px);
                backdrop-filter: blur(10px);
                &:hover {
                    background: rgba(255, 255, 255, 1);
                    color: #4A90E2;
                    transform: translateY(-2px);
                    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.3);
                }
            }
        }
    }
}

// 筛选和搜索区域样式
.filter-section {
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0);
    border-radius: $radius-lg;
    padding: 5px 24px; // 减少顶部和底部padding
    .search-box {
        margin-bottom: 24px;
        display: flex;
        justify-content: center;
        .search-input {
            max-width: 400px;
            width: 100%;
             :deep(.el-input__wrapper) {
                border-radius: $radius-lg;
                box-shadow: $shadow-md;
                border: 1px solid rgba(229, 231, 235, 0.8);
                background: rgba(255, 255, 255, 0.9);
                &:hover {
                    border-color: #4A90E2;
                    background: rgba(255, 255, 255, 1);
                }
                &.is-focus {
                    border-color: #4A90E2;
                    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
                    background: rgba(255, 255, 255, 1);
                }
            }
        }
    }
    .filter-tabs {
        display: flex;
        justify-content: center;
        gap: 8px;
        flex-wrap: wrap;
        .filter-tab {
            padding: 8px 16px;
            border-radius: $radius-md;
            background: rgba(255, 255, 255, 0.8);
            border: 1px solid rgba(229, 231, 235, 0.8);
            color: $text-secondary;
            cursor: pointer;
            transition: all $transition-normal;
            font-size: 14px;
            font-weight: $font-medium;
            &:hover {
                border-color: #4A90E2;
                color: #4A90E2;
                background: rgba(255, 255, 255, 0.9);
            }
            &.active {
                background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
                border-color: #4A90E2;
                color: white;
            }
        }
    }
}

// 友链网格区域样式 - 已在前面定义，这里移除重复定义
// 友链卡片样式
.friend-card {
    background: rgba(255, 255, 255, 0.7);
    border-radius: $radius-lg;
    padding: 24px;
    box-shadow: $shadow-md;
    border: 1px solid rgba(229, 231, 235, 0.7);
    transition: all $transition-normal;
    cursor: pointer;
    &:hover {
        transform: translateY(-4px);
        box-shadow: $shadow-lg;
        border-color: rgba(74, 144, 226, 0.3);
        background: rgba(255, 255, 255, 0.9);
    }
    .friend-header {
        display: flex;
        align-items: center;
        gap: 16px;
        margin-bottom: 20px;
        .friend-logo {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            overflow: hidden;
            flex-shrink: 0;
            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }
            .logo-placeholder {
                width: 100%;
                height: 100%;
                background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
                display: flex;
                align-items: center;
                justify-content: center;
                color: white;
                font-size: 20px;
            }
        }
        .friend-name {
            font-size: 1.1rem;
            font-weight: $font-bold;
            color: $text-primary;
            margin: 0;
            line-height: 1.2;
        }
    }
    .friend-content {
        margin-bottom: 20px;
        .friend-link {
            display: flex;
            align-items: center;
            gap: 8px;
            color: #4A90E2;
            font-size: 14px;
            margin-bottom: 12px;
            .el-icon {
                font-size: 16px;
            }
            span {
                word-break: break-all;
            }
        }
        .friend-description {
            color: $text-secondary;
            font-size: 14px;
            line-height: 1.6;
            margin: 0 0 16px 0;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .friend-tags {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            .friend-tag {
                padding: 4px 12px;
                background: rgba(74, 144, 226, 0.1);
                color: #4A90E2;
                border-radius: 12px;
                font-size: 12px;
                font-weight: $font-medium;
            }
        }
    }
    .friend-footer {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 16px;
        border-top: 1px solid $border-light;
        .friend-category {
            font-size: 12px;
            color: $text-secondary;
            text-transform: capitalize;
        }
        .friend-status {
            font-size: 12px;
            padding: 2px 8px;
            border-radius: 8px;
            font-weight: $font-medium;
            &.active {
                background: rgba(16, 185, 129, 0.1);
                color: #10B981;
            }
            &.inactive {
                background: rgba(245, 158, 11, 0.1);
                color: #F59E0B;
            }
        }
    }
}

// 分页区域样式
.pagination-section {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: $radius-lg;
    padding: 20px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
     :deep(.el-pagination) {
        .el-pager li {
            border-radius: $radius-md;
            transition: all $transition-normal;
            &:hover {
                background-color: rgba(74, 144, 226, 0.1);
                color: #4A90E2;
            }
            &.is-active {
                background-color: #4A90E2;
                color: white;
            }
        }
        .btn-prev,
        .btn-next {
            border-radius: $radius-md;
            transition: all $transition-normal;
            &:hover {
                background-color: rgba(74, 144, 226, 0.1);
                color: #4A90E2;
            }
        }
    }
}

// 空状态样式
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: $radius-xl;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    .empty-icon {
        margin-bottom: 24px;
        .el-icon {
            font-size: 64px;
            color: #CBD5E1;
        }
    }
    .empty-title {
        font-size: 1.5rem;
        font-weight: $font-bold;
        color: $text-primary;
        margin: 0 0 16px 0;
    }
    .empty-description {
        color: $text-secondary;
        font-size: 1rem;
        margin: 0;
    }
}

// 对话框样式
.apply-dialog {
     :deep(.el-dialog) {
        border-radius: $radius-lg;
        .el-dialog__header {
            border-bottom: 1px solid $border-light;
            padding: 24px 24px 16px;
            .el-dialog__title {
                font-weight: $font-bold;
                color: $text-primary;
            }
        }
        .el-dialog__body {
            padding: 24px;
        }
        .el-dialog__footer {
            border-top: 1px solid $border-light;
            padding: 16px 24px 24px;
        }
    }
    .apply-form {
        .el-form-item {
            margin-bottom: 20px;
            .el-form-item__label {
                font-weight: $font-medium;
                color: $text-primary;
            }
        }
        // 表单输入框样式修复
        .form-input {
            width: 100%;
             :deep(.el-input__wrapper) {
                border-radius: $radius-md;
                background-color: #ffffff;
                border: 1px solid #dcdfe6;
                transition: all 0.3s ease;
                &:hover {
                    border-color: #c0c4cc;
                }
                &:focus-within {
                    border-color: #409eff;
                    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
                }
            }
             :deep(.el-input__inner) {
                color: $text-primary;
                font-size: 14px;
                &::placeholder {
                    color: #909399;
                }
            }
        }
        // 图标选择区域样式
        .logo-tip {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 8px;
            padding: 8px 12px;
            background: rgba(74, 144, 226, 0.1);
            border-radius: $radius-md;
            border-left: 3px solid #4A90E2;
            .el-icon {
                color: #4A90E2;
                font-size: 14px;
            }
            span {
                color: $text-secondary;
                font-size: 12px;
                line-height: 1.4;
            }
        }
        .tags-tip {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-top: 8px;
            padding: 8px 12px;
            background: rgba(74, 144, 226, 0.1);
            border-radius: $radius-md;
            border-left: 3px solid #4A90E2;
            .el-icon {
                color: #4A90E2;
                font-size: 14px;
            }
            span {
                color: $text-secondary;
                font-size: 12px;
                line-height: 1.4;
            }
        }
    }
    .dialog-footer {
        display: flex;
        justify-content: flex-end;
        gap: 12px;
    }
}

.guidelines-dialog {
     :deep(.el-dialog) {
        border-radius: $radius-lg;
        .el-dialog__header {
            border-bottom: 1px solid $border-light;
            padding: 24px 24px 16px;
            .el-dialog__title {
                font-weight: $font-bold;
                color: $text-primary;
            }
        }
        .el-dialog__body {
            padding: 24px;
        }
    }
    .guidelines-content {
        h4 {
            font-size: 1.1rem;
            font-weight: $font-bold;
            color: $text-primary;
            margin: 24px 0 12px 0;
            &:first-child {
                margin-top: 0;
            }
        }
        ul,
        ol {
            margin: 0 0 16px 0;
            padding-left: 20px;
            li {
                color: $text-secondary;
                line-height: 1.6;
                margin-bottom: 8px;
            }
        }
        .our-info {
            background: #F8FAFC;
            border-radius: $radius-md;
            padding: 16px;
            margin-top: 16px;
            p {
                margin: 0 0 8px 0;
                color: $text-secondary;
                &:last-child {
                    margin-bottom: 0;
                }
                strong {
                    color: $text-primary;
                }
            }
        }
    }
}

// 动画效果
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

// 响应式设计
@media (max-width: 1024px) {
    .welcome-section {
        padding: 60px 0 40px;
        .welcome-title {
            font-size: 2rem;
        }
        .welcome-subtitle {
            font-size: 1.1rem;
        }
    }
    .friends-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 0 15px;
    }
    .welcome-section {
        padding: 40px 0 30px;
        .welcome-title {
            font-size: 1.75rem;
        }
        .welcome-actions {
            flex-direction: column;
            align-items: center;
            .action-btn {
                width: 200px;
            }
        }
    }
    .filter-section {
        .filter-tabs {
            justify-content: flex-start;
            overflow-x: auto;
            padding-bottom: 8px;
            .filter-tab {
                flex-shrink: 0;
            }
        }
    }
    .friends-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .friend-card {
        padding: 20px;
        .friend-header {
            .friend-logo {
                width: 40px;
                height: 40px;
            }
            .friend-name {
                font-size: 1rem;
            }
        }
    }
}

@media (max-width: 480px) {
    .welcome-section {
        .welcome-title {
            font-size: 1.5rem;
        }
        .welcome-subtitle {
            font-size: 1rem;
        }
        .welcome-description {
            font-size: 0.9rem;
        }
    }
    .friend-card {
        padding: 16px;
        .friend-content {
            .friend-description {
                -webkit-line-clamp: 4;
                line-clamp: 4;
            }
        }
    }
}